package cn.iocoder.yudao.module.system.dal.mysql.partnerapply;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.partnerapply.vo.PartnerApplyPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.partnerapply.PartnerApplyDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 合伙人申请 Mapper
 *
 * @author 万民匠心
 */
@Mapper
public interface PartnerApplyMapper extends BaseMapperX<PartnerApplyDO> {

    default PageResult<PartnerApplyDO> selectPage(PartnerApplyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PartnerApplyDO>()
                .inIfPresent(PartnerApplyDO::getUserId, reqVO.getUserIds())
                .likeIfPresent(PartnerApplyDO::getName, reqVO.getName())
                .likeIfPresent(PartnerApplyDO::getPhone, reqVO.getPhone())
                .likeIfPresent(PartnerApplyDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(PartnerApplyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PartnerApplyDO::getId));
    }

}